/*
 * @Author: yyyyjinying
 * @Date: 2024-07-29 23:22:10
 * @LastEditTime: 2024-07-29 23:24:25
 * @LastEditors: yyyyjinying
 * @Description:
 * @FilePath: /heima-shop/src/services/login.ts
 * 可以输入预定的版权声明、个性签名、空行等
 */
import type { LoginResult } from '@/types/member'

import { request } from '@/utils/http'

type LoginParams = {
  code: string
  encryptedData: string
  iv: string
}
/**
 * 小程序登录
 * @param data 请求参数
 */
export const postLoginWxMinAPI = (data: LoginParams) => {
  return request({
    method: 'POST',
    url: '/login/wxMin',
    data,
  })
}

/**
 * 小程序登录_内测版
 * @param phoneNumber 模拟手机号码
 */
export const postLoginWxMinSimpleAPI = (phoneNumber: string) => {
  return request({
    method: 'POST',
    url: '/login/wxMin/simple',
    data: {
      phoneNumber,
    },
  })
}
